package com.gxxy.spring.kp04_integration.cls02_transaction.s01_xml;

import org.springframework.jdbc.core.support.JdbcDaoSupport;

public class AccountDaoImpl extends JdbcDaoSupport implements IAccountDao {

	@Override
	public void transferIn(Long inId, Double balance) {
		this.getJdbcTemplate().update("UPDATE bankuser SET balance = balance + ? WHERE id = ?", balance, inId);
	}

	@Override
	public void transferOut(Long outId, Double balance) {
		this.getJdbcTemplate().update("UPDATE bankuser SET balance = balance - ? WHERE id = ?", balance, outId);
	}

}
